package com.lyf.design.practice.theory.behavior.strategy.nju.moviesale_20;

/**
 * @author LYF
 * @date 2022/6/25
 */
public class SaleMovie {
    private Double price;
    private Integer point;
    // 打折方式，通过接口进行抽象出去-也可采用抽象类
    private Discount discount;

    public SaleMovie(Double price, Integer point) {
        this.price = price;
        this.point = point;
    }

    // 具体需要实现的通过不同策略实现的方法-
    Double getSalePrice(){

        return discount.getLastPrice();
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    // 设置打折方式（即行为策略）
    public void setDiscount(Discount discount) {


        this.discount = discount;
    }

}
